'use strict';
/**
 * @author chenmin
 * @class  右侧面板组件===>话术设置
 */

var React = require('react');


var WordsPanelSearch = require('../../modules/panelPop/wordsPanelSearch.jsx');
var WordsPanelNav = require('../../modules/panelPop/wordsPanelNav.jsx');
var WordsPanelList = require('../../modules/panelPop/wordsPanelList.jsx');
var WordsPanelBtn = require('../../modules/panelPop/wordsPanelBtn.jsx');
var WordsPanelInput = require('../../modules/panelPop/wordsPanelInput.jsx');





var wordsPanelView = React.createClass({
      getInitialState:function(){
      /* jshint ignore:start */
      var defaulElm=<div>
                                          <WordsPanelBtn handlerAdd={this.handlerAdd}/>
                                          <WordsPanelList handlerAdd={this.handlerAdd}/>
                                    </div>;
      /* jshint ignore:end */
            return {el:defaulElm};
      },
      handlerTab:function(){
            /* jshint ignore:start */
      var defaulElm=<div>
                                          <WordsPanelBtn handlerAdd={this.handlerAdd}/>
                                          <WordsPanelList handlerAdd={this.handlerAdd}/>
                                    </div>;
      /* jshint ignore:end */
            this.setState({el:defaulElm});
      },
      handlerAdd:function(){
            this.setState({el:<WordsPanelInput handlerTab={this.handlerTab}/>});
      },
      render: function() {
            return (
                  /* jshint ignore:start */
                              <div>
                                          <WordsPanelSearch />
                                          <div   className="do-panel-body-content" >
                                                <WordsPanelNav />
                                                {this.state.el}
                                          </div>
                              </div>
                        /* jshint ignore:end */
            );
   }
});

module.exports = wordsPanelView;